package com.cwh.taskcenter.reward.gateway;

import com.cwh.taskcenter.domain.reward.gateway.RewardRecordGateWay;
import com.cwh.taskcenter.domain.reward.model.RewardRecord;
import com.cwh.taskcenter.reward.converter.RewardRecordConverter;
import com.cwh.taskcenter.reward.mapper.RewardRecordMapper;
import com.cwh.taskcenter.reward.model.RewardRecordDO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @author cwh
 */
@Slf4j
@Repository
@RequiredArgsConstructor
public class RewardRecordGateWayImpl implements RewardRecordGateWay {

    @Autowired
    private RewardRecordMapper rewardRecordMapper;

    @Override
    public void save(RewardRecord rewardRecord) {
        RewardRecordDO rewardRecordDO = RewardRecordConverter.toRewardRecordDO(rewardRecord);
        rewardRecordMapper.create(rewardRecordDO);
    }
}
